@extends('admin.layout.basic')
@section('content')
        <!-- 面包屑 -->
@include('admin.layout.breadcrumb')
<div class="wrapper wrapper-content">

    <div class="row">
        <div class="col-lg-3">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="file-manager">

                        <button class="btn btn-primary btn-block" onclick="fileManger.openUpload()">{{trans("admin/message.filemanage_uploadtitle")}}</button>
                        <button class="btn btn-warning btn-block" onclick="fileManger.reflash()">{{trans("admin/message.filemanage_reflash")}}</button>
                        <div class="hr-line-dashed"></div>
                        <h5>{{trans("admin/message.filemanage_filetypes")}}</h5>
                        <ul class="folder-list" style="padding: 0">
                            <li><a href="{{url($assets['currentCategory']->res_url)}}"><i class="fa fa-file"></i> {{trans("admin/message.filemanage_allfiletypes")}}</a></li>
                            @if(isset($extensions))
                                @foreach($extensions as $extension)
                                         <li><a href="{{url($assets['currentCategory']->res_url."?type=".$extension->extension)}}"><i class="fa fa-file"></i> {{$extension->extension}}</a></li>
                                @endforeach
                            @endif
                        </ul>

                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-9 animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">


                    @foreach($files['datas'] as $file)
                        <div class="file-box" >
                            <div class="file">

                                <a>
                                    @if($file->extension=="gif" || $file->extension=="jpeg" || $file->extension=="png" || $file->extension=="jpg")
                                        <div class="image">
                                            <img alt="image" class="img-responsive" src="{{url($file->path)}}">
                                        </div>
                                     @elseif($file->extension=="doc" || $file->extension=="docx"|| $file->extension=="html"|| $file->extension=="sql")
                                        <div class="icon">
                                            <i class="fa fa-file"></i>
                                        </div>
                                    @elseif($file->extension=="xls" || $file->extension=="xlsx")
                                        <div class="icon">
                                            <i class="fa fa-bar-chart-o"></i>
                                        </div>
                                    @elseif($file->extension=="mp3")
                                        <div class="icon">
                                            <i class="fa fa-music"></i>
                                        </div>
                                    @elseif($file->extension=="flv" || $file->extension=="mpg4" || $file->extension=="wmv")
                                        <div class="icon">
                                            <i class="img-responsive fa fa-film"></i>
                                        </div>
                                     @else
                                        <div class="icon">
                                            <i class="fa fa-file"></i>
                                        </div>
                                    @endif
                                    <div class="file-name" style="padding-bottom: 2px;">
                                        {{$file->tpl_file_name}}
                                        <br/>
                                        <small>{{trans("admin/message.created_at")}}: {{$file->created_at}}</small>


                                        <div class=" text-right">
                                            <a
                                                href="{{$file->download_url}}" title="{{$file->file_name}}" download="{{$file->file_name}}"
                                               class="btn btn-xs btn-outline btn-success"> <i class="fa fa-download"></i> </a>
                                            <a onclick="fileManger.viewUrl('{{$file->download_url}}')" class="btn btn-xs btn-outline btn-info"> <i class="fa fa-eye"></i> </a>
                                            <a onclick="fileManger.deleteFile({{$file->id}})"  class="btn btn-xs btn-outline btn-danger"> <i class="fa fa-trash"></i> </a>
                                        </div>
                                    </div>
                                </a>

                            </div>
                        </div>
                    @endforeach


                </div>

            </div>
            <div class="hr-line-dashed"></div>
            <div class=" text-left">
                <div class="col-lg-4">
                    <h5 style="vertical-align: middle">
                        {{trans("admin/message.filemanage_pages1").":".$files['currentpage']}}
                        {{trans("admin/message.filemanage_pages2").":".$files['totalpage']}}
                        {{trans("admin/message.filemanage_pages3").":".$files['total']}}</h5>
                </div>
                <div class="col-lg-8 text-right">
                    <a  href="{{url($assets['currentCategory']->res_url."?".$files['prepage'])}}" class="btn  btn-outline  btn-primary" style="width: 120px">上一页</a>
                    <a  href="{{url($assets['currentCategory']->res_url."?".$files['nextpage'])}}" class="btn btn-outline  btn-primary" style="width: 120px">下一页</a>
                </div>



            </div>
        </div>
    </div>



</div>

@include('admin.file.models.file_upload')
@endsection




